package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 类说明：推荐人类型枚举
 *
 * @author jun.liu
 */
public enum RefereesTypes implements EnumerableValue
{

    MEMBER(1, "会员"),
    STORE(2, "门店");

    public static class Converter extends BaseEnumValueConverter<RefereesTypes>
    {
    }

    private int value;
    private String desc;

    private RefereesTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static RefereesTypes getRefereeTypeByValue(int codeVal)
    {
        for (RefereesTypes refereeType : RefereesTypes.values()) {
            if (refereeType.getValue() == codeVal) {
                return refereeType;
            }
        }
        return null;
    }
}
